<?php

/**
 * Cadatividade form base class.
 *
 * @method Cadatividade getObject() Returns the current form's model object
 *
 * @package    SCBE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCadatividadeForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idatividade'         => new sfWidgetFormInputHidden(),
      'idpessoa'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cadpessoa'), 'add_empty' => false)),
      'vinculoempregaticio' => new sfWidgetFormInputText(),
      'nomeempregador'      => new sfWidgetFormInputText(),
      'cargo'               => new sfWidgetFormInputText(),
      'iniciovinculo'       => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'idatividade'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idatividade')), 'empty_value' => $this->getObject()->get('idatividade'), 'required' => false)),
      'idpessoa'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cadpessoa'))),
      'vinculoempregaticio' => new sfValidatorInteger(),
      'nomeempregador'      => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'cargo'               => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'iniciovinculo'       => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('cadatividade[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Cadatividade';
  }

}
